/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.base.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.chlitina.store.common.persistence.BaseEntity;
import com.chlitina.store.modules.expert.entity.Care;
import com.chlitina.store.modules.sys.entity.Store;

/**
 * 店面护理Entity
 * @author liujiang
 * @version 2013-09-26
 */
@Entity
@Table(name = "store_care")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class StoreCare extends BaseEntity {
	public static final int TYPE_SYS = 0;//克丽缇娜护理
	public static final int TYPE_SELF = 1;//店面自营护理
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 编号
	private Store store; 	// 店面
	private int care_type; 	// 护理类型：0 - 克丽缇娜护理1 - 店面自营护理
	private Care care; 	//克丽缇娜护理
	private StoreSelfCare storeSelfCare; // 店面自营护理
	private float single_price; 	//单次护理价位，用于散客尝试做一次护理。若为空，则此项护理不支持单次护理，若有价格，则支持单次护理。

	public StoreCare() {
	}

	public StoreCare(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(cascade={CascadeType.REFRESH}, fetch = FetchType.LAZY) 
	@JoinColumn(name="STORE_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public Store getStore() {
		return store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	public int getCare_type() {
		return care_type;
	}

	public void setCare_type(int care_type) {
		this.care_type = care_type;
	}
	
	@ManyToOne(cascade={CascadeType.REFRESH}, fetch = FetchType.LAZY) 
	@JoinColumn(name="CT_CARE_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public Care getCare() {
		return care;
	}

	public void setCare(Care care) {
		this.care = care;
	}

	@ManyToOne(cascade={CascadeType.REFRESH}, fetch = FetchType.LAZY) 
	@JoinColumn(name="SS_CARE_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public StoreSelfCare getStoreSelfCare() {
		return storeSelfCare;
	}

	public void setStoreSelfCare(StoreSelfCare storeSelfCare) {
		this.storeSelfCare = storeSelfCare;
	}
	
	public float getSingle_price() {
		return single_price;
	}

	public void setSingle_price(float single_price) {
		this.single_price = single_price;
	}

}


